<?php

namespace app\controller\api;

use app\BaseController;
use think\response\Json;

class Order extends BaseController
{
    public function create(): Json
    {
        if(!$this->request->isPost()) throw new \Exception('请求方式错误',7025);
        if(empty($this->request->param('uid'))) throw new \Exception('请登录',7065);
        return $this->success($this->app->make(\app\model\Order::class)->createOrder());
    }

    public function lst(): Json
    {
        if(empty($this->request->param('uid'))) throw new \Exception('请登录',7065);
        return $this->success($this->app->make(\app\model\Order::class)->getPage());
    }
}
